@extends('layouts.app')
@section('content')
    <div class="content">
        <a class="btn btn-info btn-sm" href="{{ redirect()->back()->getTargetUrl() }}"> 返回 </a>
        <br/>
        <br/>
        {!! form($form) !!}
    </div>
@endsection
@push('scripts')
<script>
    // 按照客户要求, 修改表单样式
    // 表单通过后台生成, 所以通过js调整样式
    
    $('.content').find('form').addClass('form-inline')
    $('.content').find('form').find('label').attr('style', 'width:80px;text-align:center')
    $('.form-group').attr('style', 'margin:10px 0px;')

    $('[for="user_id"]').parent().after('<br>');
    $('[for="zs_money"]').parent().after('<br>');

    $("#users-select.select2").select2({
        width: "500px",
        ajax: {
            dataType: 'json',
            delay: 250,
            url: function () {
                return '{{ route('admin.recharge.select_user') }}';
            },
            processResults: function (data) {
                return {
                    results: $.map(data, function(row, key) {
                        return {
                            id: key,
                            text: row
                        };
                    })
                };
            }
        }
    });
</script>
@endpush
